# Maintainer: Felix Yan <felixonmars@archlinux.org>
# Contributor: Josip Ponjavic <josipponjavic at gmail dot com>
# Contributor: Xu Fasheng <fasheng.xu[AT]gmail.com>

pkgname=dtkwidget
pkgver=5.6.7
_commit=cf1eceb9d93a09fa7615557d2952eb26466f135e
pkgrel=1
pkgdesc='Deepin graphical user interface library'
arch=('loong64' 'x86_64')
url="https://github.com/linuxdeepin/dtkwidget"
license=('LGPL3')
# qt5-imageformats is needed for webp (dci) icons
depends=('dtkcore' 'dtkgui' 'gcc-libs' 'glibc' 'gsettings-qt' 'libx11' 'libxcb' 'libxext' 'libxi'
         'qt5-base' 'qt5-imageformats' 'qt5-svg' 'qt5-x11extras' 'startup-notification' 'xcb-util')
makedepends=('git' 'cmake' 'ninja' 'qt5-tools' 'gtest' 'doxygen')
replaces=('deepin-tool-kit')
source=("git+https://github.com/linuxdeepin/dtkwidget.git#commit=$_commit")
sha512sums=('SKIP')

build() {
  cd dtkwidget
  cmake . -GNinja \
      -DMKSPECS_INSTALL_DIR=lib/qt/mkspecs/modules/ \
      -DBUILD_DOCS=ON \
      -DBUILD_PLUGINS=OFF \
      -DQCH_INSTALL_DESTINATION=share/doc/qt \
      -DCMAKE_INSTALL_LIBDIR=lib \
      -DCMAKE_INSTALL_PREFIX=/usr \
      -DVERSION=$pkgver \
      -DCMAKE_BUILD_TYPE=None
  ninja
}

package() {
  cd dtkwidget
  DESTDIR="$pkgdir" ninja install
}
